package com.adou.common.util.Config;

import com.adou.common.util.UtilPath;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Component
public class WebConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/upload/pic/**")
                .addResourceLocations("file:///" + UtilPath.getRootPath() + "upload/pic/");
    }
}
